<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
		xmlns:ice="http://www.icesoft.com/icefaces/component"  
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages id="messages" globalOnly="true" styleClass="message" errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"/>
    
    <ice:form id="listcourseFormId" styleClass="edit">
      <ice:panelGroup  id="searchGroup" styleClass="formBorderHighlight">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <td class="iceDatTblColHdr2">
                    <ice:outputText id="listCourseId" value="Course search"/>
                 </td>
              </tr>
         </table>	
         <ice:panelGroup id="listPanelGroupCourseId" styleClass="edit">
		
            <s:decorate id="descriptiondecId" template="layout/display.xhtml">
                <ui:define name="label">description</ui:define>
                <ice:inputText id="listdescriptionTextId" 
                          value="#{courseList.course.description}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="designerdecId" template="layout/display.xhtml">
                <ui:define name="label">designer</ui:define>
                <ice:inputText id="listdesignerTextId" 
                          value="#{courseList.course.designer}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="fairwaysdecId" template="layout/display.xhtml">
                <ui:define name="label">fairways</ui:define>
                <ice:inputText id="listfairwaysTextId" 
                          value="#{courseList.course.fairways}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="greensdecId" template="layout/display.xhtml">
                <ui:define name="label">greens</ui:define>
                <ice:inputText id="listgreensTextId" 
                          value="#{courseList.course.greens}"
				  partialSubmit="true"/>
            </s:decorate>

            <s:decorate id="namedecId" template="layout/display.xhtml">
                <ui:define name="label">name</ui:define>
                <ice:inputText id="listnameTextId" 
                          value="#{courseList.course.name}"
				  partialSubmit="true"/>
            </s:decorate>

          
   
	  </ice:panelGroup>
  
        
        <div class="actionButtons">
            <ice:commandButton id="listSearchButtonId" value="Search" action="/CourseList.xhtml"/>
        </div>
      </ice:panelGroup> 
    </ice:form>
    
    <ice:panelGroup styleClass="formBorderHighlight">

    <h3>course  search results</h3>

    <div class="searchResults" id="listcourseResults">
    <ice:outputText value="The course search returned no results." 
               rendered="#{empty courseList.resultList}"/>
               
    <ice:dataTable id="courseListTableId" 
                  var="course"
                value="#{courseList.resultList}" 
            resizable="true"
        columnClasses="allCols"
             rendered="#{not empty courseList.resultList}">
        <ice:column id="listidId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listidLinkId"
                             value="id #{courseList.order=='id asc' ? messages.down : ( courseList.order=='id desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='id asc' ? 'id desc' : 'id asc'}"/>
                </s:link>
            </f:facet>
            #{course.id}&amp;nbsp;
        </ice:column>
        <ice:column id="listdescriptionId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listdescriptionLinkId"
                             value="description #{courseList.order=='description asc' ? messages.down : ( courseList.order=='description desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='description asc' ? 'description desc' : 'description asc'}"/>
                </s:link>
            </f:facet>
            #{course.description}&amp;nbsp;
        </ice:column>
        <ice:column id="listdesignerId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listdesignerLinkId"
                             value="designer #{courseList.order=='designer asc' ? messages.down : ( courseList.order=='designer desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='designer asc' ? 'designer desc' : 'designer asc'}"/>
                </s:link>
            </f:facet>
            #{course.designer}&amp;nbsp;
        </ice:column>
        <ice:column id="listColumnfacilityId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		                id="listcolumnHeaderfacilityId"
                             value="facility id #{courseList.order=='facility.id asc' ? messages.down : ( courseList.order=='facility.id desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='facility.id asc' ? 'facility.id desc' : 'facility.id asc'}"/>
                </s:link>
            </f:facet>
            #{course.facility.id}
        </ice:column>
        <ice:column id="listfairwaysId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listfairwaysLinkId"
                             value="fairways #{courseList.order=='fairways asc' ? messages.down : ( courseList.order=='fairways desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='fairways asc' ? 'fairways desc' : 'fairways asc'}"/>
                </s:link>
            </f:facet>
            #{course.fairways}&amp;nbsp;
        </ice:column>
        <ice:column id="listgreensId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listgreensLinkId"
                             value="greens #{courseList.order=='greens asc' ? messages.down : ( courseList.order=='greens desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='greens asc' ? 'greens desc' : 'greens asc'}"/>
                </s:link>
            </f:facet>
            #{course.greens}&amp;nbsp;
        </ice:column>
        <ice:column id="listnameId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listnameLinkId"
                             value="name #{courseList.order=='name asc' ? messages.down : ( courseList.order=='name desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='name asc' ? 'name desc' : 'name asc'}"/>
                </s:link>
            </f:facet>
            #{course.name}&amp;nbsp;
        </ice:column>
        <ice:column id="listnumHolesId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listnumHolesLinkId"
                             value="numHoles #{courseList.order=='numHoles asc' ? messages.down : ( courseList.order=='numHoles desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='numHoles asc' ? 'numHoles desc' : 'numHoles asc'}"/>
                </s:link>
            </f:facet>
            #{course.numHoles}&amp;nbsp;
        </ice:column>
        <ice:column id="listsignatureHoleId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listsignatureHoleLinkId"
                             value="signatureHole #{courseList.order=='signatureHole asc' ? messages.down : ( courseList.order=='signatureHole desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='signatureHole asc' ? 'signatureHole desc' : 'signatureHole asc'}"/>
                </s:link>
            </f:facet>
            #{course.signatureHole}&amp;nbsp;
        </ice:column>
        <ice:column id="listyearBuiltId">
            <f:facet name="header">
                <s:link styleClass="columnHeader"
		             id="listyearBuiltLinkId"
                             value="yearBuilt #{courseList.order=='yearBuilt asc' ? messages.down : ( courseList.order=='yearBuilt desc' ? messages.up : '' )}">
                    <f:param name="order" value="#{courseList.order=='yearBuilt asc' ? 'yearBuilt desc' : 'yearBuilt asc'}"/>
                </s:link>
            </f:facet>
            #{course.yearBuilt}&amp;nbsp;
        </ice:column>
        <ice:column id="listColumnCourseId">
            <f:facet name="header">action</f:facet>
            <s:link view="/#{empty from ? 'Course' : from}.xhtml" 
                   value="Select" 
                      id="listcourseLinkId">
                <f:param name="courseId" 
                        value="#{course.id}"/>
            </s:link>
        </ice:column>
    </ice:dataTable>

    </div>
</ice:panelGroup>

    <div class="tableControl">
      
        <s:link view="/CourseList.xhtml" 
            rendered="#{courseList.previousExists}" 
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPagecourseListId">
          <f:param name="firstResult" value="0"/>
        </s:link>
        
        <s:link view="/CourseList.xhtml" 
            rendered="#{courseList.previousExists}" 
               value="#{messages.left} Previous Page"
                  id="previousPagecourseListId">
            <f:param name="firstResult" 
                    value="#{courseList.previousFirstResult}"/>
        </s:link>
        
        <s:link view="/CourseList.xhtml" 
            rendered="#{courseList.nextExists}" 
               value="Next Page #{messages.right}"
                  id="nextPagecourseListId">
            <f:param name="firstResult" 
                    value="#{courseList.nextFirstResult}"/>
        </s:link>
        
        <s:link view="/CourseList.xhtml" 
            rendered="#{courseList.nextExists}" 
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPagecourseListId">
            <f:param name="firstResult" 
                    value="#{courseList.lastFirstResult}"/>
        </s:link>
        
    </div>
    
    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/CourseEdit.xhtml"
                    id="listCreatecourseId" 
                 value="Create course">
            <f:param name="courseId"/>
        </s:button>
    </s:div>
    
</ui:define>

</ui:composition>

